1. Field of the Invention
The present invention relates to virtual machine systems, and more particularly, to a method and a device for scheduling true CPU resources for a virtual machine system.
2. Description of Related Technology
As show in FIG. 1, in a virtual machine system, there are several operating systems (OSs) running on a virtual machine monitor (VMM), and each OS comprises one or more virtual CPU (VCPU). Therefore, it may be necessary for the VMM to assign true CPU resources to the VCPUs based on a certain resource scheduling algorithm. The manner in which the true CPU resources are assigned will affect the performance of the virtual machine system.
Now, the scheduling algorithms for virtual machines are mainly categorized into two kinds: a borrowed virtual time (BVT) method and a SEDF method.
According to the BVT method, the VMM assigns averagely all the true CPU resources to the VCPUs in the upper-level OSs based on the current true CPU resources, so that each VCPU occupies the same amount of the true CPU resources.
However, as is well-known, in the environment of the virtual machine, loads on the VCPUs in the respective OSs are different, while the BVT scheduling algorithm makes a VCPU with a large load and a VCPU with a small load obtain almost same true CPU time. Thus, it is possible that the true CPU time assigned to the VCPU with the large load is insufficient while the true CPU time assigned to the VCPU with the small load is redundant. As a result, the CPU resources are wasted, and thus it is impossible to utilize the true CPU resources to a maximum extent.
Further, according to the SEDF method, the VMM “scores” the respective OSs based on requests for the CPU resources from the respective upper-level OSs and the number of current processes, and then assigns more true CPU resources to an OS requesting for more resources.
The SEDF method overcomes the disadvantage of the BVT method, and is able to utilize the true CPU resources more efficiently. However, it may be necessary to provide special programs in guest operation systems (GOSs) to count these resources. For different OSs (e.g. XP, Linux and Vista), it may be necessary to design different programs. Therefore, this method is not versatile.